package com.gm.mapper;

import com.github.pagehelper.PageHelper;
import com.gm.bean.UserInfo;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Select;

import java.util.List;

/**
 * @Author Administrator
 * @Date 2020/6/23 10:36
 **/
public interface UserMapper {
    //登陆
    @Select("select * from tb_userinfo where nickname=#{nickname}")
    UserInfo getUserByName(String nickname);
    //全查
    @Select("select * from tb_userinfo")
    List<UserInfo> findAll(Integer page,Integer size);
    //增加
    @Insert("insert into tb_userinfo(nickname,password,realname,phone,gender,age,createTime,updateTime) values(#{nickname},#{password},#{realname},#{phone},#{gender},#{age},#{createTime},#{updateTime})")
    void addUser(UserInfo userInfo);
    //删除
    @Delete("delete from tb_userinfo where id = {#id}")
    void delUser(Integer id);
}
